import { Empty } from 'antd-mobile';
import React from 'react'
import { Link } from 'react-router-dom';
import { imgPre } from '../../../../request/http';

import './newpeople.less'

function newpeople(props) {
  const { getnew, timeArr } = props;
  // console.log(getnew);
  return (
    <div className='newpeople'>
      <h3 className='tit'>新人专享</h3>
      {/* 2.页面倒计时 */}
      <span>
        <i>{timeArr.h}</i>:<i>{timeArr.m}</i>:<i>{timeArr.s}</i>
      </span>

      {/* 3.商品内容展示 */}
      <div className='npGoods'>
        <div className='npGoods-tit'>1重礼</div>
        <ul>
          {getnew.length > 0 ? <>
            {getnew.map((item) => {
              return (
                <Link to={'/detail/'+item.id+'/1'} key={item.id}>
                  <li className='npGoods-li'>
                    <div className='img'><img src={imgPre + item.img} alt="" /></div>
                    <p>{item.goodsname}</p>
                    <p>现价：{item.price}</p>
                    <del>原价：{item.market_price}</del>
                  </li>
                </Link>
              );
            })}
          </> : <Empty description='暂无数据' />}
        </ul>
      </div>
    </div>
  )
}

export default React.memo(newpeople);

